<template>
	<div>
		
		<div class="boxone">
			<div>
				<div>
					<img :src="gan1.goods_img" >
				</div>
				<div class="tex">
					<h4>{{gan1.goods_name}}</h4>
					<span style="font-size: 10px;">销量：{{gan1.sales}}</span>
					<p style="color: #FF0000;">{{gan1.price|ind}}</p>
				</div>
			</div>
			<div>
				<div>
					<img :src="gan2.goods_img" >
				</div>
				<div class="tex">
					<h4>{{gan2.goods_name}}</h4>
					<span style="font-size: 10px;">销量：{{gan2.sales}}</span>
					<p style="color: #FF0000;">{{gan2.price|ind}}</p>
				</div>
			</div>
			<div>
				<div>
					<img :src="gan3.goods_img" >
				</div>
				<div class="tex">
					<h4>{{gan3.goods_name}}</h4>
					<span style="font-size: 10px;">销量：{{gan3.sales}}</span>
					<p style="color: #FF0000;">{{gan3.price|ind}}</p>
				</div>
			</div>
			<div>
				<div>
					<img :src="gan4.goods_img" >
				</div>
				<div class="tex">
					<h4>{{gan4.goods_name}}</h4>
					<span style="font-size: 10px;">销量：{{gan4.sales}}</span>
					<p style="color: #FF0000;">{{gan4.price|ind}}</p>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		mounted(){
			this.list_sj();
		},
		data() {
			return{
				
				gan1:[],
				gan2:[],
				gan3:[],
				gan4:[]
				
			}	
		},
		 methods:{
			  list_sj(){
				  this.$http.post('https://4de16698-d9f4-443a-b416-ef1037cce952.bspapp.com/http/api/get_car_goods_list',{
					  
				  }).then(res=>{
				  		console.log(res)
				  		let gg = res.data
						this.gan1 = gg[0]
						this.gan2 = gg[1]
						this.gan3 = gg[2]
						this.gan4 = gg[3]
				  	})
				  	.catch(err=>{
				  		console.log(err)
				  	});
			  }
		 },
		 filters:{
			 ind:function(val){
				 return val = "$"+val
			 }
		 }
	}
</script>

<style>
	
	.boxone{
			display: flex;
		    align-content: center;
		    justify-content: space-around;
		    flex-wrap: wrap;
			border: 0px solid red;
			
	}
	.boxone>div{
		/* height: 100px; */
		width: 49%;
		border: 0px solid red;
		float: left;
		display: block;
	}
	img{
		width: 100%;
		
	}
	.tex{
		width: 100%;
		/* height: 100px; */
	}
	
</style>
